package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.FlowLayout;


import java.sql.Date;
import java.util.Calendar;

import javax.swing.JTextPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.JLabel;
/**
 *  this class is Graphic user interface of Marketing that serve the Marketing Employee, which extends AbstractGUI
 * @author jacob
 *
 */
public class MarketingGui extends AbstractGUI {
	
/** all buttons of Marketing*/
	
	private JButton logOut = null;
	private JButton CreateNewMark= null;
	private JButton newProduct= null;
	private JButton analyze= null;
	private JButton insertFromDB= null;
	
	/**
	 * constructor 
	 * this constructor add all the  Button on the Frame
	 */
	public MarketingGui(){
		
		getContentPane().add(getInsertFromDB());
		getContentPane().add(getLogOut());
		getContentPane().add(getCreateNewMark());
		getContentPane().add(getNewProduct());
		getContentPane().add(getAnalyze());
		getContentPane().setBackground(Color.LIGHT_GRAY);
		
		this.setLayout(null);
		this.setTitle("                                                  Marketing department");
		this.setBounds(500, 200, 500, 400);
		//this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE );
		this.setVisible(true);
		this.setResizable(false);
	}
	/*****************************************Getters and Setters of Buttons*****************************/
	public JButton getLogOut() {
		if(logOut == null){
			logOut = new JButton("logOut");
			logOut.setBounds(5, 5, 120, 20);
		}	
		return logOut;
	}

	public JButton getCreateNewMark() {
		if(CreateNewMark == null){
			CreateNewMark = new JButton("create new marketing pattern");
			CreateNewMark.setBounds(220, 50,225,35);
		}
		return CreateNewMark;
	}



	public JButton getNewProduct() {
		if(newProduct == null){
			newProduct = new JButton("new Product");  //new Product
			newProduct.setBounds(10, 50, 180, 35);
		}
		return newProduct;
	}



	public JButton getAnalyze() {
		if(analyze == null){
			analyze = new JButton("analyze");
			analyze.setBounds(10, 100, 180, 35);
		}
		return analyze;
	}

	public JButton getInsertFromDB() {
		if(insertFromDB == null){
			insertFromDB = new JButton("Insert Potential customer"); //insert Potential customer
			insertFromDB.setBounds(220, 100, 225, 35);
		}
		return insertFromDB;
	}
	
	/********************************************add to all buttons ActionListener ************/
	public void addLogoutActionListener(ActionListener listener){
		logOut.addActionListener(listener);
	}
	
	public void addcreateNewMarketingPatternActionListener(ActionListener listener){
		CreateNewMark.addActionListener(listener);
	}
	public void addNewProductActionListener(ActionListener listener){
		newProduct.addActionListener(listener);
	}
	
	public void addAnalyzeActionListener(ActionListener listener){
		analyze.addActionListener(listener);
	}
	public void addInsertFromDBActionListener(ActionListener listener){
		insertFromDB.addActionListener(listener);
	}

}
